home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-05-07 | 2.1 KB | 58 lines | [TEXT/R*ch] |
- -- Creator to MPS
- -- Droplet to change file creator to MPS .
- -- Requires "Progress Bar", "Finder Liaison", "String Commands"
- -- from The Tao of AppleScript
- -- January 1994 by Dale M. Greer
-
- on open (docList)
- -- The Progress Bar stuff can be eliminated if you don't care for it
- set counter to (number of items in docList)
-
- tell application "Progress Bar 1.0"
- make window
- tell window 1
- set the Name to "Creator to MPS "
- set the minimum value of progress bar 1 to 1
- set the maximum value of progress bar 1 to counter
- set the current value of progress bar 1 to counter
- set the caption of progress bar 1 to "PreparingI" & (counter as string)
- activate
- end tell
- end tell
-
- tell application "Finder Liaison 1.0"
- repeat with tmp in docList
- -- Note many "as string"s.
- -- If you don't do this, AppleScript makes a list. Headache!
- copy tmp as string to temp
- copy (characters 1 thru ((offset of ":" in temp) - 1) of temp)
- as string to theDisk
- copy (characters ((offset of ":" in temp) + 1) thru end of temp)
- as string to temp
- copy (characters 1 thru ((offset of ":" in temp) - 1) of temp)
- as string to theFolder
- copy (characters ((offset of ":" in temp) + 1) thru end of temp)
- as string to theFile
- copy (Get Type of File (theFile as string) of Folder theFolder
- of Disk theDisk) to fileType -- Finder Liaison command
-
- if fileType is "TEXT" then
- tell window 1 of application "Progress Bar 1.0"
- set the caption of progress bar 1 to "Changing creator of:"
- set the subcaption of progress bar 1 to theFile
- end tell
-
- Set Creator of File (theFile as string) of Folder theFolder
- of Disk theDisk to "MPS " -- Finder Liaison command
- end if
-
- tell window 1 of application "Progress Bar 1.0" to set the current value
- of progress bar 1 to counter
- set counter to counter - 1
- end repeat
- end tell
-
- tell application "Finder Liaison 1.0" to quit
- tell application "Progress Bar 1.0" to quit
- end open
-